﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

using System.Drawing.Drawing2D;


namespace SafeHomeSystem
{
    public partial class CallForHelp : Form
    {

        private bool isOK = false;
        private int count = -1;

        public CallForHelp()
        {
            InitializeComponent();

        }

        private void button1_Click(object sender, EventArgs e)
        {
            Graphics iG = this.CreateGraphics();
            GraphicsPath iGP = new GraphicsPath();

            Pen iSPen = new Pen(Color.Blue, 6);

            iSPen.StartCap = LineCap.Triangle;
            iSPen.EndCap = LineCap.ArrowAnchor;

            //iGP = CreateGraphicsPathByControls(button2, button3);
            iGP.AddLine(125, 150, 150, 150);
            iG.DrawPath(iSPen, iGP);
            isOK = true;
            this.label1.Visible = true;
            
        }

        private void timer1_Tick(object sender, EventArgs e)
        {
            if (isOK)
            {
                count = (count + 1) % 30;
                Graphics iG = this.CreateGraphics();
                GraphicsPath iGP = new GraphicsPath();

                Pen iSPen = new Pen(Color.Blue, 6);

                iSPen.StartCap = LineCap.Triangle;
                iSPen.EndCap = LineCap.ArrowAnchor;

                //iGP = CreateGraphicsPathByControls(button2, button3);
                iGP.AddLine(125 + count * 5, 150, 150 + count * 5, 150);
                iG.DrawPath(iSPen, iGP);
              
            }

            if (count == 29)
            {
                this.label2.Visible = true;
                this.label3.Visible = true;
                this.label4.Visible = true;
                this.label5.Visible = true;
            }
        }

        private void label4_Click(object sender, EventArgs e)
        {

        }
    }
}
